Friend Class Recent
    Dim m_recent As New ArrayList(10)

    Sub New()
        m_recent = New ArrayList(10)
        Load()
    End Sub
    Friend Sub Load()
        Dim f_str As String
        For i As Integer = 0 To 9
            f_str = GetRegistryKey("RecentFile_" & i, "", "Files")
            If f_str <> "" Then m_recent.Add(f_str)
        Next
    End Sub
    Friend Sub UnLoad()
        Dim f_count As Integer = m_recent.Count - 1
        If f_count >= 9 Then f_count = 9
        For i As Integer = 0 To f_count
            SetRegistryKey("RecentFile_" & i, m_recent(i), "Files")
        Next
    End Sub
    Friend Function ToArray() As String()
        Dim f_return(m_recent.Count) As String
        For i As Integer = 0 To m_recent.Count - 1
            f_return(i) = m_recent(i)
        Next
        Return f_return
    End Function
    Friend Sub Add(ByVal strFile As String)
        If m_recent.Contains(strFile) Then
            m_recent.Remove(strFile)
        End If
        m_recent.Insert(0, strFile)
    End Sub
End Class
